package tvs;
import java.util.ArrayList;
import java.util.List;

//import java.net.InetAddress;

public class Game {
	private String id;
	private String ipaddress;
	private String gamename;
	private List<String> playerList;//PlayerList playerList;
	
	private String username;
	private int maxPlayers;
	private String settings;
	private List<String> banList;
	
	public Game(String gamename, String ip, String username, String settings, String id)
	{
		this.ipaddress = ip;
		this.gamename = gamename;
		this.username = username;
		this.playerList = new ArrayList<String>();//PlayerList();
		this.id = id;
		this.settings = settings;
		this.banList = new ArrayList<String>();
	}
	
	/*public Game(String gamename, String ip, String name, int maxPlayers)
	{
		this.ipaddress = ip;
		this.gamename = gamename;
		this.username = username;
		this.playerList = new PlayerList();
	}*/
	
	public String getName()
	{
		return this.gamename;
	}
	public String getIP()
	{
		return this.ipaddress;
	}
	public String getUsername()
	{
		return this.username;
	}
	public List<String> getPlayerList()//PlayerList getPlayerList()
	{
		return this.playerList;
	}
	public String getStringOfPlayers()
	{
		String list = "";
		for(String s : this.playerList)
		{
			list += s + "-";
		}
		return list.substring(0, list.length()-1);
	}
	public void setPlayerList(List<String> pl)//PlayerList pl)
	{
		List<String> list = pl;
		System.out.println("players in game 1");
		for(String s : list)
		{
			System.out.println("players in game: "+s);
		}
		
		
		
		this.playerList = pl;
		System.out.println("players in game 2");
		List<String> list2 = this.playerList;
		for(String s : list2)
		{
			System.out.println("players in game: "+s);
		}
		
		
		
		System.out.println("players in game 3");
		List<String> list3 = this.playerList;
		for(String s : list3)
		{
			System.out.println("players in game: "+s);
		}
	}
	public List<String> getListOfPlayers()
	{
		return this.playerList;
	}
	public String getSettings()
	{
		return settings;
	}
	public void setSettings(String sett)
	{
		this.settings = sett;
	}
	public String getId()
	{
		return id;
	}
	public String getPlayers()
	{
		String players = "";
		for(String s : playerList)//Player p : playerList)//.getList())
		{
			//players += p.getName() + "-";
			players += s + "-";
		}
		return players.substring(0, players.length()-1);
	}
	
	public void addToBanList(String ban)
	{
		this.banList.add(ban);
	}
	
	public List<String> getBanList()
	{
		return banList;
	}
}
